﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Unity;
using Skynet.BusinessEntities;

namespace Skynet.BusinessLogic.DataAccess
{
    public class DynamicReportRepository :MasterRepository<BusinessEntities.DynamicReport>,  IDynamicReportRepository
    {
        public DynamicReportRepository(IUnityContainer container)
            : base(container)
        { 

        }
        public BusinessEntities.DynamicReport GetReportDefinition(string groupname, string reportname)
        {
            var ctx = this.ContainerService.Resolve<SkyNetLibraryEntities>();
            var query = (from c in ctx.DynamicReports where c.groupName == groupname && c.reportName == reportname select c).SingleOrDefault();
            return query;
        }

    }
}
